package com.prs.crm.service.oa;

import java.io.File;

import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;

import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.MailBox;
import com.prs.crm.domain.oa.MailItem;
import com.prs.crm.service.BaseService;

public interface MailItemService extends BaseService<MailItem>{

	/**
	 * 查找是否存在指定原始ID的邮件
	 * @param box
	 * @param messageId 邮件原始ID
	 * @param reciver 收件人
	 * @return
	 */
	boolean exist(MailBox box,String messageId,Person reciver);
	
	
	/**
	 * 发送邮件
	 * @param item
	 * @param sender
	 */
	void executeSendMail(MailItem item,File[] files,String[] fileNames,Person sender);
	
	/**
	 * 邮件已读
	 * @param item
	 */
	void executeRead(MailItem item);
	
	/**
	 * 收件箱
	 * @param criteria
	 * @param page
	 * @param reciver
	 * @return
	 */
	PaginationSupport listInBox(DetachedCriteria criteria,PaginationSupport page,Person reciver);
	
	
	/**
	 * 发件箱
	 * @param criteria
	 * @param page
	 * @param reciver
	 * @return
	 */
	PaginationSupport listOutBox(DetachedCriteria criteria,PaginationSupport page,Person reciver);
}
